//@ sourceURL=ImportPositionView.js
Ext.ns("ImportPositionView");
ImportPositionView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        ImportPositionView.superclass.constructor.call(this, {
            id : "ImportPositionView",
            title : "重要岗位人员管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
         var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'ImportPositionForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "人员名称"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_personName_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "重要岗位人员列表",
                rowActions:true,
                listUrl : __ctxPath + "/safecultruetrain/listImportPosition.do",
                removeUrl : __ctxPath + "/safecultruetrain/deleteImportPosition.do",
                fields : [ "id", 'years', 'institution', "typeOfWorkNum", "typeOfWork", "personNum","personName","identityCard","department","credentials","remark"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    width : 50,
                    sortable : true
                }, {
                    header : "工种编号",
                    dataIndex : "typeOfWorkNum",
                    width : 100
                }, {
                    header : "工种",
                    dataIndex : "typeOfWork",
                    width : 70
                }, {
                    header : "人员编号",
                    dataIndex : "personNum",
                    width : 70
                }, {
                    header : "人员姓名",
                    dataIndex : "personName",
                    width : 100
                },
                {
                    header : "身份证号",
                    dataIndex : "identityCard",
                    width : 100
                }, {
                    header : "部门",
                    dataIndex : "department",
                    width : 100
                }, new Ext.grid.Column({
                    header : "资格证书",
                    dataIndex : "scIdps",
                    sortable : false,
                    scope:this,
                    width :70,
                    renderer : function(j, i, g, m, h) {
                        var cfg={
                        		credentialsId : g.data.id
                        }
                        var k = "";
                        k += '<a href="#" title="资格证书" onclick="javaScript:ImportPositionView.credentails(\'' + g.json.id  + '\');">资格证书</a>';;
                              
                                return k;
                    }
                })]
            },
            tree : {
                treeUrl : __ctxPath + "/safecultruetrain/treeLoadImportPosition.do"
            }
            
        });
         
         return yearGridComponents;
    }
});

ImportPositionView.credentails = function(id){
    new CredentialsWindow({
    	credentialsId : id ,
    	operation : Constant.Operation.EDIT
    }).show();
};


